module ApplicationHelper
  def sortable(path, column, title = nil)
    title ||= column.to_s.titleize
    direction = (column.to_s == sort_column && sort_direction == 'asc') ? 'desc' : 'asc'
    link_to title, path.call(column, direction)
  end
end
